﻿<%@ WebHandler Language="C#" Class="ContainerUnFreezeHandler" %>

using System;
using System.Web;
using System.Web.SessionState;
using System.Data;
using System.Collections;
using System.Collections;
using System.Collections.Generic;
using BusinessRule.DTO;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using BusinessRule.Business;
using BusinessRule.IBusiness;
using BusinessRule.BusinessFactory;
using DatabaseAccess.DBUtility;
using Camstar.WebClient.FormsBuilder.WebForm;
using Camstar.WebClient.WebServicesProxy.InSiteWebServices;
using External.APICalling;

public class ContainerUnFreezeHandler : IHttpHandler, IRequiresSessionState
{
    CurrentUserInfo m_UserInfo;
    private uLMSContainerIBusiness m_ContainerObj = uMESBusinessFactory.instance.GetuLMSContainerObject();
    public void ProcessRequest (HttpContext context) {
       try
        {
            var action = context.Request["action"].ToString();
            m_UserInfo = (CurrentUserInfo)context.Session["CurrentUserInfo"];
            switch (action)
            {
                case "GetHoldContainerData"://获取工艺变更暂停批次信息
                    GetHoldContainerData(context);
                    break;
                default:
                    break;
            }
        }
       catch (Exception ex)
       {
           var result = new uMESProcessResult();
           result.Result = false;
           result.Message = ex.Message;
           context.Response.ContentType = "text/html";
           context.Response.Write(JsonConvert.SerializeObject(result));
       }
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

    void GetHoldContainerData(HttpContext context) 
    {
        var para = new Dictionary<string, string>();
        string selectSQL = @"";
        string pageSize = context.Request["pageSize"].ToString();
        string pageNumber = context.Request["pageNumber"].ToString();
        var paraPage = new uMESPagingDataDTO();
        paraPage.CurrentPageIndex = Convert.ToInt32(pageNumber);
        paraPage.PageSize = Convert.ToInt32(pageSize);
        paraPage.strSQL = selectSQL;
        uMESProcessResult result = m_ContainerObj.GetCurrentContianerInfo(para);
        context.Response.Write(JsonConvert.SerializeObject(result)); 
    }
    
    
    

}